<?php
/**
 * Search a Customer -
 *
 * @author Xavier VILAIN
 *
 */

use Fox\SearchEngine;
use Fox\Generator;
use Fox\Html\Interval;
use Fox\Dao\SqlFragment;
use Nawa\Messages;
use Fox\Html\Button;
use Nawa\Customer;

$searchScreen = new Fox\Html\Screen\Search\Basic('search',new Customer(),null,null,10);
$searchScreen->filter(array(new SqlFragment('type = ?',array(Customer::TYPE_BASIC))));
$searchScreen->screen()->mainTitle('<div class="page-title">'.Msg(Messages::BUNDLE,Messages::TITLE_SEARCH_PROMOTOR).'</div>');
$searchScreen->screen()->toolbar()->add(new Button('create',Generator::url('customers','create')));
$searchScreen->block()->add(new Interval('cdate'));
$searchScreen->searchEngineOptions(SearchEngine::MODE_LIKE);
$searchScreen->grid(Xview::instance()->component('customers','result'));
echo $searchScreen->render();